Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve StorageInterface, add method get #660

Merged
merged 3 commits into from
Aug 27, 2024
Merged

Conversation

Enet4
Copy link
Collaborator

@Enet4 Enet4 commented Jul 21, 2023

This PR proposes a backwards-compatible extension to StorageInterface with default method get. Unlike at, get is designed to retrieve up to a single item in storage, so it does not need file system tree traversal or building up iterables and iterators.

A default implementation is provided that uses at underneath, but implementors may wish to override it for more efficiency.

This PR also includes a few quality-of-life improvements, including some clarifications to other methods in the plugin interface.

Summary

  • Add default method StorageInterface#get, to retrieve a single item from storage
    • update code in core to use it where suitable
    • also correct image servlet to only query for instances to DIM providers if specified
  • Fix example code in at
  • Clarify in list that a trailing forward slash means that it's a directory

- specifically for retrieving a single item from storage,
  without deep file traversal or requiring any iterables
- default impl uses `at` underneath to implement it
- update code in core to use it where suitable
- also correct image servlet to only query for instances
  to DIM providers if specified
- Fix example code in #at
- Clarify in #list that a trailing forward slash
  means that it's a directory
@Enet4 Enet4 requested a review from bastiao July 21, 2023 10:16
@Enet4 Enet4 self-assigned this Jul 21, 2023
Copy link
Member

@bastiao bastiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that it useful.
I will merge it soon.

@Enet4 Enet4 added this to the 3.4.0 milestone Aug 25, 2023
@Enet4
Copy link
Collaborator Author

Enet4 commented Aug 25, 2023

@bastiao Since the next Dicoogle version is intended to be a patch version, let's keep this PR on hold until we plan to deploy a feature release.

Copy link
Collaborator Author

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might as well fix this typo.

Copy link
Collaborator

@tiberio-baptista tiberio-baptista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are quite nice, and current behavior of these components remains functional. LGTM!

@Enet4
Copy link
Collaborator Author

Enet4 commented Aug 23, 2024

@bastiao Next version of Dicoogle should be 3.4.0, so we're ready to start merging this and the other ones in the milestone:

@bastiao bastiao merged commit 169d3eb into dev Aug 27, 2024
2 checks passed
@bastiao bastiao deleted the imp/sdk/filestorage-get branch August 27, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants